import http from "@/utils/http";

// 用户头像上传
export function upload(data) {
  return http.post("/file/upload", data);
}

// 获取已上传的分片索引
export function getUploadSliceIndex(hash) {
  return http.get(`/file/upload/slice/${hash}`);
}

// 分片上传
export function uploadSlice(data) {
  return http.post("/file/upload/slice", data);
}

// 分片校验
export function uploadSliceCheck(hash, type, count) {
  return http.get(`/file/upload/slice/check/${hash}/${type}/${count}`);
}

// 分片合并
export function sliceMerge(data) {
  return http.post("/file/upload/sliceMerge", data);
}

// 分片合并校验
export function sliceMergeCheck(hash, type) {
  return http.get(`/file/upload/sliceMerge/finish/${hash}/${type}`);
}
